<template>
  <div class="demo">
    <Com @changeTitle="changeTitle" :title="title" />
  </div>
</template>

<script>
import { reactive, toRefs } from "vue";
import Com from "./Children.vue";
export default {
  name: "demo",
  components: {
    Com,
  },
  setup() {
    const state = reactive({
      title: "first",
    });

    const changeTitle = (val) => {
      state.title = val;
    };

    return {
      ...toRefs(state),
      changeTitle,
    };
  },
};
</script>

<style lang='scss' scoped>
</style>
